from machine import UART

uart2 = ""

def uart_cb(result_list):
    printf("success?%d",result_list[0])
    printf("received len:%d",result_list[2])
    rece_len = result_list[2]
    if(rece_len>0):
        uart2.read(result_list[2])
        printf("received data:%s",uart2.read(result_list[2]))
    else:
        printf("received data:null")

def uart_init():
    uart2 = UART(UART.UART2,921600,8,0,1,0)
    uart2.set_callback(uart_cb)